/**
  ******************************************************************************
  * @file           : route_ec.h
  * @brief          : Header for main.c file.
  *                   This file contains the common defines of the application.
  ******************************************************************************
  * @attention
  *
  ******************************************************************************
  */
#ifndef __route_ec_H
#define __route_ec_H

#include "route_base.h"
#include "route_ec_interface.h"

typedef enum
{
	/* 上传和下达onenet的类 */
  ROUTE_PLTYP_EC_MD  = 0xa1u,
  ROUTE_PLTYP_EC_JT  = 0xa2u,
  ROUTE_PLTYP_EC_DL1 = 0xa3u,
  ROUTE_PLTYP_EC_DL2 = 0xa4u,
  ROUTE_PLTYP_EC_SK  = 0xa5u,
  ROUTE_PLTYP_EC_TD  = 0xa6u,
	
	ROUTE_PLTYP_EC_CTRL_FN  = 0xb0u,      /* 风机控制指令 */
  ROUTE_PLTYP_EC_CTRL_SL  = 0xb1u,      /* 氺帘控制指令 */
  ROUTE_PLTYP_EC_CTRL_NQ  = 0xb2u,      /* 暖气控制指令 */
  ROUTE_PLTYP_EC_CTRL_VF  = 0xb3u,      /* 变频器控制指令 */
	
	ROUTE_PLTYP_EC_STATE_FN = 0xc0u,
	ROUTE_PLTYP_EC_STATE_SL = 0xc1u,
	ROUTE_PLTYP_EC_STATE_NQ = 0xc2u,
	ROUTE_PLTYP_EC_STATE_VF = 0xc3u,
	
	ROUTE_PLTYP_EC_COLLECTOR = 0xd0,
}Route_PlType_Ec_Type;

/* cmd */
typedef struct
{
  uint8_t root;
  uint8_t device;
  uint8_t subtyp;
  char    did[ROUTE_DID_BUFLEN];
  uint8_t td;
  uint8_t act;
}Route_Post_Ctr_Ec_Type;

extern uint8_t Route_ec_up(Route_PayloadType *rtpl);

extern uint8_t Route_ec_down_mufn(const char *str, uint8_t len);
extern uint8_t Route_ec_down_musl(const char *str, uint8_t len);
extern uint8_t Route_ec_down_munq(const char *str, uint8_t len);
extern uint8_t Route_ec_down_muvfd(const char *str, uint8_t len);

extern uint8_t Route_ec_down_allpara(const char *str, uint8_t len);
extern uint8_t Route_ec_down_jtpara(const char *str, uint8_t len);
extern uint8_t Route_ec_down_dlpara(const char *str, uint8_t len);
extern uint8_t Route_ec_down_skpara(const char *str, uint8_t len);
extern uint8_t Route_ec_down_tdpara(const char *str, uint8_t len);

extern uint8_t Route_ec_down_md(const char *str, uint8_t len);
extern uint8_t Route_ec_down_jt(const char *str, uint8_t len);
extern uint8_t Route_ec_down_gdbj(const char *str, uint8_t len);
extern uint8_t Route_ec_down_xckhd(const char *str, uint8_t len);
extern uint8_t Route_ec_down_dl1(const char *str, uint8_t len);
extern uint8_t Route_ec_down_dl2(const char *str, uint8_t len);
extern uint8_t Route_ec_down_sk(const char *str, uint8_t len);
extern uint8_t Route_ec_down_td(const char *str, uint8_t len);

/* 仅用于周期线程,上传需要周期发送的数据 */
extern void Route_ec_tonet_collector(void);
extern void Route_ec_tonet_fnst(void);
extern void Route_ec_tonet_slst(void);
extern void Route_ec_tonet_nqst(void);
extern void Route_ec_tonet_vfst(void);
extern void Route_ec_tonet_md(void);
extern void Route_ec_tonet_jt(void);
extern void Route_ec_tonet_dl1(void);
extern void Route_ec_tonet_dl2(void);
extern void Route_ec_tonet_sk(void);
extern void Route_ec_tonet_td(void);

#endif /* __route_ec_H */
